﻿using FluentMigrator;

namespace ProgressTracker.Data.Migrations
{
    [Migration(201403020000)]
    public class _1132_Create_Day_And_Day_Task_Table : Migration
    {
        public override void Up()
        {
            Create.Table("Days")
                .WithColumn("Id").AsInt32().NotNullable().PrimaryKey().Identity()
                .WithColumn("Date").AsDate().NotNullable()
                .WithColumn("Notes").AsString();

            Create.Table("Day_Task")
                .WithColumn("DayId").AsInt32().ForeignKey()
                .WithColumn("TaskId").AsInt32().ForeignKey()
                .WithColumn("Complete").AsBoolean();
        }

        public override void Down()
        {
            Delete.Table("Days");
            Delete.Table("Day_Task");
        }
    }
}
